Skip to content

feat(ads): pixels, conversions API and custom conversions - #39

Merged
alihesari merged 5 commits into
mainfrom
feature/ads-tracking
Oct 18, 2026
Merged

alihesari merged 5 commits into
mainfrom
feature/ads-tracking

Conversation

@alihesari

Copy link
Copy Markdown
Member

What changed

  • uploadConversions() now returns ConversionUploadResult (id, accepted, eventCount, replayed) instead of an int, and takes an optional $idempotencyKey sent as Idempotency-Key. Breaking for anyone reading the int; noted in the CHANGELOG Unreleased section.
  • sendConversions() posts to /ads/conversions/events with a required Idempotency-Key argument. Named sendConversions because sendConversionEvents() already exists for LinkedIn conversion rules.
  • listConversionEvents() reads stored batches (ConversionBatch, events as hashes only).
  • Pixels: pixels, createPixel, pixel, updatePixel, sharePixel, pixelStats, eventMatchQuality with AdPixel, AdPixelDetail, AdPixelStats, AdPixelEventCount, EventMatchQuality, EventMatchKey.
  • Custom conversions: customConversions, createCustomConversion, customConversion, updateCustomConversion, deleteCustomConversion with CustomConversion, CustomConversionRule.
  • HttpClient::request() gained a fifth $headers argument merged over the defaults (needed for the idempotency header).
  • README, CHANGELOG (Unreleased) and CLAUDE.md updated. No version bump, no tag.

Tests

./vendor/bin/phpunit: OK (221 tests, 1049 assertions). ./vendor/bin/phpcs: clean.
New tests/AdsTrackingTest.php covers the idempotent send (header sent, replay read), pixel reads, pixel writes, and custom conversion create/list/get/update/delete.

Owed

  • Downstream wrappers (fopost-laravel, fopost-symfony, fopost-woocommerce) do not call uploadConversions, so no matching PR was needed; their dependency constraint bump and CHANGELOG note stay owed at release time.

@alihesari
alihesari merged commit c7dd78a into main Oct 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant